package org.example.thread.testSequence;

/**
 * @author liyishan
 * @date 2023/8/3 11:18
 * @apiNote
 */

public class TestSequence {
    public static void main(String[] args)throws  InterruptedException {
        Thread thread1 =new Thread(() ->{
            System.out.println("thread1");
        });
        Thread thread2 =new Thread(() ->{
            System.out.println("thread2");
        });
        Thread thread3 =new Thread(() ->{
            System.out.println("thread3");
        });
        thread1.start();
        //阻塞main()  要等thread1 走完才继续main（）
        thread1.join();
        thread2.start();
        //阻塞main()  要等thread2 走完才继续main（）
        thread2.join();
        thread3.start();
        //阻塞main()  要等thread3 走完才继续main（）
        thread3.join();

    }
}
